package top.itmeans.yes.admin.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.itmeans.yes.common.api.CommonResult;
import top.itmeans.yes.entity.CompanyAddress;
import top.itmeans.yes.service.CompanyAddressService;

import java.util.List;

/**
 * <p>
 * 公司收发货地址表 前端控制器 OMS
 * </p>
 *
 * @author Yiming.Cao
 * @since 2022-04-28
 */
@RestController
@RequestMapping("/companyAddress")
public class CompanyAddressController {
    @Autowired
    private CompanyAddressService companyAddressService;

    /**
     * GET [host:ip/serverPath]/companyAddress/list
     */
    @ApiOperation("获取所有收货地址")
    @GetMapping(value = "/list")
    public CommonResult<List<CompanyAddress>> list() {
        List<CompanyAddress> companyAddressList = companyAddressService.list();
        return CommonResult.success(companyAddressList);
    }
}
